package o;

import java.util.ArrayList;
import java.util.List;

public class ji<C, T, A> implements Cloneable {
    private final a<C, T, A> ˊ;
    private List<C> ˋ;
    private int ˎ;
    private long[] ˏ;
    private long ॱ;

    public static abstract class a<C, T, A> {
        public abstract void ˊ(C c, T t, int i, A a);
    }

    public /* synthetic */ Object clone() throws CloneNotSupportedException {
        return ˋ();
    }

    public synchronized void ˎ(T t, int i, A a) {
        this.ˎ++;
        ˋ(t, i, a);
        this.ˎ--;
        if (this.ˎ == 0) {
            if (this.ˏ != null) {
                for (int length = this.ˏ.length - 1; length >= 0; length--) {
                    long j = this.ˏ[length];
                    if (j != 0) {
                        ˏ((length + 1) * 64, j);
                        this.ˏ[length] = 0;
                    }
                }
            }
            if (this.ॱ != 0) {
                ˏ(0, this.ॱ);
                this.ॱ = 0;
            }
        }
    }

    private void ˊ(T t, int i, A a) {
        ˏ(t, i, a, 0, Math.min(64, this.ˋ.size()), this.ॱ);
    }

    private void ˋ(T t, int i, A a) {
        int size = this.ˋ.size();
        int length = this.ˏ == null ? -1 : this.ˏ.length - 1;
        ˎ(t, i, a, length);
        ˏ(t, i, a, (length + 2) * 64, size, 0);
    }

    private void ˎ(T t, int i, A a, int i2) {
        if (i2 < 0) {
            ˊ(t, i, a);
            return;
        }
        long j = this.ˏ[i2];
        int i3 = (i2 + 1) * 64;
        int min = Math.min(this.ˋ.size(), i3 + 64);
        ˎ(t, i, a, i2 - 1);
        ˏ(t, i, a, i3, min, j);
    }

    private void ˏ(T t, int i, A a, int i2, int i3, long j) {
        long j2 = 1;
        while (i2 < i3) {
            if ((j & j2) == 0) {
                this.ˊ.ˊ(this.ˋ.get(i2), t, i, a);
            }
            j2 <<= 1;
            i2++;
        }
    }

    private boolean ˎ(int i) {
        if (i < 64) {
            if (((1 << i) & this.ॱ) != 0) {
                return true;
            }
            return false;
        } else if (this.ˏ == null) {
            return false;
        } else {
            int i2 = (i / 64) - 1;
            if (i2 >= this.ˏ.length) {
                return false;
            }
            if ((this.ˏ[i2] & (1 << (i % 64))) == 0) {
                return false;
            }
            return true;
        }
    }

    private void ˏ(int i, long j) {
        long j2 = Long.MIN_VALUE;
        for (int i2 = (i + 64) - 1; i2 >= i; i2--) {
            if ((j & j2) != 0) {
                this.ˋ.remove(i2);
            }
            j2 >>>= 1;
        }
    }

    public synchronized ji<C, T, A> ˋ() {
        ji<C, T, A> jiVar;
        CloneNotSupportedException e;
        try {
            jiVar = (ji) super.clone();
            try {
                jiVar.ॱ = 0;
                jiVar.ˏ = null;
                jiVar.ˎ = 0;
                jiVar.ˋ = new ArrayList();
                int size = this.ˋ.size();
                for (int i = 0; i < size; i++) {
                    if (!ˎ(i)) {
                        jiVar.ˋ.add(this.ˋ.get(i));
                    }
                }
            } catch (CloneNotSupportedException e2) {
                e = e2;
                e.printStackTrace();
                return jiVar;
            }
        } catch (CloneNotSupportedException e3) {
            CloneNotSupportedException cloneNotSupportedException = e3;
            jiVar = null;
            e = cloneNotSupportedException;
            e.printStackTrace();
            return jiVar;
        }
        return jiVar;
    }
}
